home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C
/
Applications
/
Moscow ML 1.31
/
source code
/
mosml
/
src
/
config
/
auto-aux
/
signals.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1996-07-03
|
473 b
|
26 lines
|
[
TEXT/R*ch
]
/* To determine the semantics of signal handlers
(System V: signal is reset to default behavior on entrance to the handler
BSD: signal handler remains active). */
#include <stdio.h>
#include <signal.h>
int counter;
void sig_handler(dummy)
int dummy;
{
counter++;
}
int main(argc, argv)
int argc;
char ** argv;
{
signal(SIGINT, sig_handler);
counter = 0;
kill(getpid(), SIGINT);
kill(getpid(), SIGINT);
return (counter == 2 ? 0 : 1);
}